package com.hetang.maijiayun.adaptertools.b2cinterface.paipai.request;

import java.util.Date;
import java.util.Map;

public class SellerSearchDealListRequest extends Request {

	/** 卖家QQ号 */
	private Long sellerUin;

	/**
	 * 查询的是否为历史订单 如果需要查询下单时间超过三个月的订单，则是查找历史订单了
	 */
	private Boolean historyDeal = false;

	/**
	 * 时间类型 空字符串（默认）:表示不使用时间筛选项 CREATE:表示timeBegin和timeEnd是下单时间
	 * UPDATE:表示timeBegin和timeEnd是订单最后更新时间
	 */
	private String timeType;

	/**
	 * 起始时间 格式: yyyy-MM-dd HH:mm:ss
	 */
	private Date timeBegin;

	/** 结束时间 */
	private Date timeEnd;

	/** 订单状态 */
	private String dealState;

	/** 商品编码 */
	private String itemCode;

	/**
	 * 商品名称关键字 目标订单的商品标题，表示查找和该商品标题相关的订单， 例如如果设置为“森林”，那么商品标题中带有“森林”词的订单列表就会被查找出来
	 * */
	private String itemNameKey;

	/** 是否列出商品 */
	private Boolean needItemList = false;

	/** 订单编码 */
	private String dealCode;

	/** true:顺序排序；false：逆序排序 */
	private Boolean orderDesc = false;

	/** 页数索引 */
	private Long pageIndex = 1L;

	/** 页大小 ,不要超过20 */
	private Long pageSize = 20L;
	/**
	 * 订单的评价状态 100=需要买家评价的 101=需要卖家评价的 102=买家已评价的 103=卖家已评价的
	 * */
	private Long dealRateState;

	public String getApiMethodName() {
		return "/deal/sellerSearchDealList.xhtml";
	}

	public String getDealCode() {
		return dealCode;
	}

	public Long getDealRateState() {
		return dealRateState;
	}

	public String getDealState() {
		return dealState;
	}

	public Boolean getHistoryDeal() {
		return historyDeal;
	}

	public String getItemCode() {
		return itemCode;
	}

	public String getItemNameKey() {
		return itemNameKey;
	}

	public Boolean getNeedItemList() {
		return needItemList;
	}

	public Boolean getOrderDesc() {
		return orderDesc;
	}

	public Long getPageIndex() {
		return pageIndex;
	}

	public Long getPageSize() {
		return pageSize;
	}

	public Map<String, String> getParams() {
	    params.put("pureData", Integer.toString(pureData));
	    params.put("needRoot", Integer.toString(needRoot));
		return params;
	}

	public Long getSellerUin() {
		return sellerUin;
	}

	public Date getTimeBegin() {
		return timeBegin;
	}

	public Date getTimeEnd() {
		return timeEnd;
	}

	public String getTimeType() {
		return timeType;
	}

	public void setDealCode(String dealCode) {
		this.dealCode = dealCode;
		if(dealCode != null){
			params.put("dealCode", dealCode);
		}
	}

	public void setDealRateState(Long dealRateState) {
		this.dealRateState = dealRateState;
		if(dealRateState != null){
			params.put("dealRateState", dealRateState.toString());
		}
	}

	public void setDealState(String dealState) {
		this.dealState = dealState;
		if(dealState != null){
			params.put("dealState", dealState);
		}
	}

	public void setHistoryDeal(Boolean historyDeal) {
		this.historyDeal = historyDeal;
		if(historyDeal != null){
			params.put("historyDeal", historyDeal == true? "1" : "0");
		}
	}

	public void setItemCode(String itemCode) {
		this.itemCode = itemCode;
		if(itemCode != null){
			params.put("itemCode", itemCode);
		}
	}

	public void setItemNameKey(String itemNameKey) {
		this.itemNameKey = itemNameKey;
		if(itemNameKey != null){
			params.put("itemNameKey", itemNameKey);
		}
	}

	public void setNeedItemList(Boolean needItemList) {
		this.needItemList = needItemList;
		if(needItemList != null){
			params.put("needItemList", needItemList == true? "1" : "0");
		}
	}

	public void setOrderDesc(Boolean orderDesc) {
		this.orderDesc = orderDesc;
		if(orderDesc != null){
			params.put("orderDesc", orderDesc == true? "1" : "0");
		}
	}

	public void setPageIndex(Long pageIndex) {
		this.pageIndex = pageIndex;
		if(pageIndex != null){
			params.put("pageIndex", pageIndex.toString());
		}
	}

	public void setPageSize(Long pageSize) {
		this.pageSize = pageSize;
		if(pageSize != null){
			params.put("pageSize", pageSize.toString());
		}
	}

	public void setSellerUin(Long sellerUin) {
		this.sellerUin = sellerUin;
		if(sellerUin != null){
			params.put("sellerUin", sellerUin.toString());
		}
	}

	public void setTimeBegin(Date timeBegin) {
		this.timeBegin = timeBegin;
		if(timeBegin != null){
			params.put("timeBegin", format.format(timeBegin));
		}
	}

	public void setTimeEnd(Date timeEnd) {
		this.timeEnd = timeEnd;
		if(timeEnd != null){
			params.put("timeEnd", format.format(timeEnd));
		}
	}

	public void setTimeType(String timeType) {
		this.timeType = timeType;
		if(timeType != null){
			params.put("timeType", timeType);
		}
	}

}
